package ws.rest.books;

//Service designator
import javax.ws.rs.Path;

//Map HTTP methods to methods in this class
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;

//Content handlers 
import javax.ws.rs.Produces;
import javax.ws.rs.Consumes;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;

//Parameter injection
import javax.ws.rs.PathParam;

@Path("/books")
public interface BookService {

	@POST
	@Consumes(MediaType.APPLICATION_XML)
	@Produces(MediaType.APPLICATION_XML)
	public Response createBook(@Context UriInfo uriInfo,Book book);
	
	@GET
	@Produces(MediaType.APPLICATION_XML)
	public BookList getBook();
	
	@Path("{id}")
	@GET
	@Produces(MediaType.APPLICATION_XML)
	public Book getBook(@PathParam("id") int id);
	
	@Path("{id}")
	@PUT
	@Consumes(MediaType.APPLICATION_XML)
	public void updateBook(@PathParam("id") int id, Book book_updated);
	
	@Path("{id}")
	@DELETE
	public void delete(@PathParam("id") int id);
}
